home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1987-01-11 | 1.1 KB | 49 lines |
- 10 REM Program to examine the contents
- 20 REM of the memory. Enter the first
- 30 REM and last addresses to be displayed.
- 40 REM Address and memory contents are
- 50 REM both displayed in hexadecimal.
- 60 REM ** You can only access 64K on
- 70 REM each run, and cannot read over
- 80 REM the segment boundries in one
- 90 REM run.
- 100 REM
- 110 REM Author : Eddie Jaeger
- 120 REM
- 130 REM Written 4/18/82
- 140 REM
- 141 CLS
- 150 INPUT "First,Last Address, in Hex > ",F$,L$
- 160 IF LEN(F$)<5 THEN Y$=F$: GOSUB 440: F$=Y$
- 170 IF LEN(L$)<5 THEN Y$=L$: GOSUB 440: L$=Y$
- 180 S1$ = LEFT$(F$,1)
- 190 S1 = VAL("&H"+S1$)
- 200 S = S1 * &H1000
- 210 X$ = RIGHT$(F$,4)
- 220 GOSUB 400
- 230 F = X
- 240 X$ = RIGHT$(L$,4)
- 250 GOSUB 400
- 260 L = X
- 270 DEF SEG = S
- 280 FOR C1 = F TO L STEP 8
- 290 C1$ = HEX$(C1)
- 300 IF LEN(C1$) < 5 THEN Y$ = C1$: GOSUB 440
- 310 A$ = S1$ + RIGHT$(Y$,4)
- 320 PRINT USING "\ \"; A$;" ";
- 330 FOR C2 = C1 TO C1 + 7
- 340 PRINT USING "\\";HEX$(PEEK(C2));" ";
- 350 NEXT C2
- 360 PRINT
- 370 NEXT C1
- 380 DEF SEG
- 390 END
- 400 REM CONVERT STRING X$ TO DECIMAL X
- 410 X1 = VAL("&H" + X$)
- 420 IF X1 < 0 THEN X = 65535+X1 ELSE X = X1
- 430 RETURN
- 440 REM MAKE Y$ 5 CHARACTERS LONG
- 450 Y$ = "0" + Y$
- 460 IF LEN(Y$) < 5 THEN GOTO 450
- 470 RETURN
-